import { createWebHistory, createWebHashHistory, createRouter } from 'vue-router'

// 路由信息
const routes = [
  {
    path: '/',
    component: () => import('@/views/index.vue')
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes: routes,
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      return { top: 0 }
    }
  },
})

export default router
